import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { RouteComponent } from './pages/route/route.component';
import { ManComponent } from './pages/man/man.component';
import { SetComponent } from './pages/set/set.component';
import { WorkComponent } from './pages/work/work.component';
import { ExtractComponent } from './pages/extract/extract.component';
import { AttendanceSetComponent } from './pages/attendance-set/attendance-set.component';
import { AttendanceRecordComponent } from './pages/attendance-record/attendance-record.component';
import { AttendanceLeaveComponent } from './pages/attendance-leave/attendance-leave.component';
import { PatrolComponent } from './pages/patrol/patrol.component';
import { CompeteComponent } from './pages/compete/compete.component';
import { SaleTargetComponent } from './pages/sale-target/sale-target.component';
import { TargetComponent } from './pages/target/target.component';
import { MemberComponent } from './pages/member/member.component';
import { PointComponent } from './pages/point/point.component';
import { HeadComponent } from './pages/head/head.component';

import { SetDetailComponent } from './pages/set-detail/set-detail.component';
import { RouteDetailComponent } from './pages/route-detail/route-detail.component';
import { ManDetailComponent } from './pages/man-detail/man-detail.component';
import { WorkDetailComponent } from './pages/work-detail/work-detail.component';
import { ExtractDetailComponent } from './pages/extract-detail/extract-detail.component';
import { AttSetDetailComponent } from './pages/att-set-detail/att-set-detail.component';
import { AttRecordDetailComponent } from './pages/att-record-detail/att-record-detail.component';
import { AttLeaveDetailComponent } from './pages/att-leave-detail/att-leave-detail.component';
import { PatrolDetailComponent } from './pages/patrol-detail/patrol-detail.component';
import { CompeteDetailComponent } from './pages/compete-detail/compete-detail.component';
import { SaleTargetDetailComponent } from './pages/sale-target-detail/sale-target-detail.component';

const routes: Routes = [
     /** 业务设置  **/
    {
        path: 'set', component: SetComponent, data: {
            breadcrumbs: [{ title: '业务主页' }]
        },
        children: [
            {
                path: 'detail', component: SetDetailComponent, data: {
                    breadcrumbs: [{ title: '业务主页', path: '/business/set' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'route', component: RouteComponent, data: {
            breadcrumbs: [{ title: '拜访路线', path: '/business/route' }]
        },
        children: [
            {
                path: 'detail', component: RouteDetailComponent, data: {
                    breadcrumbs: [{ title: '拜访路线', path: '/business/route' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'man', component: ManComponent, data: {
            breadcrumbs: [{ title: '业务员配置', path: '/business/man' }]
        },
        children: [
            {
                path: 'detail', component: ManDetailComponent, data: {
                    breadcrumbs: [{ title: '业务员配置', path: '/business/man' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'work', component: WorkComponent, data: {
            breadcrumbs: [{ title: '工作交接', path: '/business/work' }]
        },
        children: [
            {
                path: 'detail', component: WorkDetailComponent, data: {
                    breadcrumbs: [{ title: '工作交接', path: '/business/work' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'extract', component: ExtractComponent, data: {
            breadcrumbs: [{ title: '提成设置', path: '/business/extract' }]
        },
        children: [
            {
                path: 'detail', component: ExtractDetailComponent, data: {
                    breadcrumbs: [{ title: '提成设置', path: '/business/extract' }, { title: '新增' }]
                }
            },
        ]
    },
   /** 考勤设置  **/
    {
        path: 'att-set', component: AttendanceSetComponent, data: {
            breadcrumbs: [{ title: '考勤设置', path: '/business/att-set' }]
        },
        children: [
            {
                path: 'detail', component: AttSetDetailComponent, data: {
                    breadcrumbs: [{ title: '考勤设置', path: '/business/att-set' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'att-record', component: AttendanceRecordComponent, data: {
            breadcrumbs: [{ title: '考勤记录', path: '/business/att-record' }]
        },
        children: [
            {
                path: 'detail', component: AttRecordDetailComponent, data: {
                    breadcrumbs: [{ title: '考勤记录', path: '/business/att-record' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'att-leave', component: AttendanceLeaveComponent, data: {
            breadcrumbs: [{ title: '请假记录', path: '/business/att-leave' }]
        },
        children: [
            {
                path: 'detail', component: AttLeaveDetailComponent, data: {
                    breadcrumbs: [{ title: '请假记录', path: '/business/att-leave' }, { title: '新增' }]
                }
            },
        ]
    },
    /** 拜访管理  **/
    {
        path: 'patrol', component: PatrolComponent, data: {
            breadcrumbs: [{ title: '巡店管理' }]
        },
        children: [
            {
                path: 'detail', component: PatrolDetailComponent, data: {
                    breadcrumbs: [{ title: '巡店管理', path: '/business/patrol' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'compete', component: CompeteComponent, data: {
            breadcrumbs: [{ title: '竞品反馈' }]
        },
        children: [
            {
                path: 'detail', component: CompeteDetailComponent, data: {
                    breadcrumbs: [{ title: '竞品反馈', path: '/business/compete' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'sale-target', component: SaleTargetComponent, data: {
            breadcrumbs: [{ title: '销售目标'}]
        },
        children: [
            {
                path: 'detail', component: SaleTargetDetailComponent, data: {
                    breadcrumbs: [{ title: '销售目标', path: '/business/sale-target' }, { title: '新增' }]
                }
            },
        ]
    },
    {
        path: 'target', component: TargetComponent, data: {
            breadcrumbs: [{ title: '目标达成'}]
        },
    },
   /** 社团  **/
    {
        path: 'head', component: HeadComponent, data: {
            breadcrumbs: [{ title: '团长管理' }]
        },
    },
    {
        path: 'point', component: PointComponent, data: {
            breadcrumbs: [{ title: '取货点管理' }]
        },
    },
    {
        path: 'member', component: MemberComponent, data: {
            breadcrumbs: [{ title: '会员管理' }]
        },
    },
 
];


export const declarationComponents = [
    RouteComponent,
    ManComponent,
    SetComponent,
    WorkComponent,
    ExtractComponent,
    AttendanceSetComponent,
    AttendanceRecordComponent,
    AttendanceLeaveComponent,
    PatrolComponent,
    CompeteComponent,
    SaleTargetComponent,
    TargetComponent,
    HeadComponent,
    MemberComponent,
    PointComponent,

    SetDetailComponent,
    RouteDetailComponent,
    ManDetailComponent,
    WorkDetailComponent,
    ExtractDetailComponent,
    AttSetDetailComponent,
    AttRecordDetailComponent,
    AttLeaveDetailComponent,
    PatrolDetailComponent,
    CompeteDetailComponent,
    SaleTargetDetailComponent,

];

export const entryComponents = [
    RouteComponent,
    ManComponent,
    SetComponent,
    WorkComponent,
    ExtractComponent,
    AttendanceSetComponent,
    AttendanceRecordComponent,
    AttendanceLeaveComponent,
    PatrolComponent,
    CompeteComponent,
    SaleTargetComponent,
    TargetComponent,
    HeadComponent,
    MemberComponent,
    PointComponent,


    SetDetailComponent,
    RouteDetailComponent,
    ManDetailComponent,
    WorkDetailComponent,
    ExtractDetailComponent,
    AttSetDetailComponent,
    AttRecordDetailComponent,
    AttLeaveDetailComponent,
    PatrolDetailComponent,
    CompeteDetailComponent,
    SaleTargetDetailComponent,

];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class BusinessRoutingModule { }
